package com.teamone.etl.exception;

/**
 * @Description 统一返回信息
 * @Author WangZhuoRan
 * @Date 2021-01-14 20:55
 */
public enum CommonCode{

    /**
     信息
     */
    SUCCESS(true,1,"操作成功！"),
    FAIL(false,0,"操作失败！"),

    IS_NAME_EXISTS(false,10000,"规则引擎名称重复"),

    SERVER_ERROR(false,99999,"服务器繁忙！"),
    INVALID_PARAM(false,88888,"非法参数！"),

    ID_CAN_NOT_BE_NULL(false,10001,"ID不能为空！"),
    PARAMETER_EXISTS(false,10002,"名称已存在或权重为空！"),
    SQL_PARAM_ERROR(false,11111,"SQL语句错误"),
    SQL_UNSUPPORTED(false,11112,"不支持的SQL语句"),
    CONNECTION_FAIL(false,11113,"数据源连接失败"),
    THIS_OBJECT_NULL(false,11114,"对象不能为空"),
    RUNNING_PLEASE_CLOSE(false,11115,"正在运行，不能修改！"),

    ENTERPRISE_EXISTS(false,2000,"该企业已注册"),
    ENTERPRISE_MOBILE_INVALID(false,2001,"手机号码格式不正确"),
    ENTERPRISE_LICENSE_INVALID(false,2002,"社会统一信用代码格式不正确"),
    ENTERPRISE_PASSWORD_INVALID(false,2003,"密码格式不正确"),
    ENTERPRISE_PEOPLE_INVALID(false,2004,"姓名格式不正确"),
    ENTERPRISE_POSITION_INVALID(false,2005,"职位格式不正确"),
    ENTERPRISE_DATE_INVALID(false,2006,"企业注册日期格式不正确"),
    ENTERPRISE_NAME_INVALID(false,2007,"企业名称格式不正确"),
    ENTERPRISE_URL_INVALID(false,2008,"请上传营业执照"),
    ENTERPRISE_ADDRESS_INVALID(false,2009,"企业地址格式不正确"),
    ENTERPRISE_DETAILED_ADDRESS_INVALID(false,2010,"企业详细地址格式不正确"),

    OLD_PASSWORD_INVALID(false,2011,"旧密码不符"),
    OLD_OLD_PASSWORD_INVALID(false,2012,"两次旧密码不一样"),
    FILE_TOO_BIG(false,2013,"只支持10MB以下的图片"),
    INCORRECT_IMG_FORMAT(false,2014,"只支持BMP/GIF/JPG/PNG格式的图片"),

    MOBILE_ALREADY_EXSISTS(false,3000,"这个号码已经注册过了"),
    NOT_REGIST(false,3001,"这个号码还没有注册"),
    PASSWORD_ERROR(false,3002,"密码错误"),

    INPUT_OR_OUTPUT_FIELD_NULL(false,40001,"输入或输出字段不能为空"),
    TASK_PROCESS_NULL(false,40002,"该任务未设计流程");

    /**
     * 操作是否成功
     */
    boolean success;
    /**
     * 操作代码
     */
    int code;
    /**
     * 提示信息
     */
    String message;
    CommonCode(boolean success,int code, String message){
        this.success = success;
        this.code = code;
        this.message = message;
    }

    public boolean success() {
        return success;
    }
    public int code() {
        return code;
    }

    public String msg () {
        return message;
    }

}
